import 'dart:ui';

import 'package:flutter/foundation.dart';

class PaginationWorker {
  static Future<List<String>> paginate(Map<String, dynamic> params) async {
    return compute(_pageListIsolate, params);
  }

  static List<String> _pageListIsolate(Map<String, dynamic> params) {
    // 从参数中解包数据
    final content = params['content'];
    final pageWidth = params['pageWidth'];
    final pageHeight = params['pageHeight'];
    final fontSize = params['fontSize'];
    List<String> pages = [];

    // 原有_pageList逻辑稍作修改后移植到这里
    final textStyle = TextStyle(fontSize: fontSize);
    // ... 保持原有_pageList实现逻辑 ...
    return pages;
  }
}
